package LearnAlgorithm.f_字符串;

public class g判断A串的旋转字符串全等于B串 {
	public static void main(String[] args) {
		String bString = "aabcd";
		String aString = "bcdaa";
		System.out.println(isRotateApi(aString, bString));
	}
	
	/**
	 * 判断A串的旋转字符串全等于B串
	 * @param aString
	 * @param bString
	 * @return
	 */
	public static boolean isRotateApi(String aString, String bString) {
		if (aString.length() != bString.length()) {
			return false;
		}
		StringBuilder stringBuilder = new StringBuilder(bString).append(bString);//谁转拼谁
		return stringBuilder.toString().contains(aString);
	}
}
